package com.fulu.game.bi.controller.market;

import com.fulu.game.bi.common.controller.BaseController;
import com.fulu.game.bi.entity.po.roi.NewRangePayStat;
import com.fulu.game.bi.entity.vo.Result;
import com.fulu.game.bi.entity.vo.market.NewAddUserDisplayVO;
import com.fulu.game.bi.entity.vo.market.NewAddUserQueryVO;
import com.fulu.game.bi.entity.vo.market.NewRangePayQueryVO;
import com.fulu.game.bi.redis.service.market.NewAddUserService;
import com.fulu.game.bi.redis.service.market.NewRangePayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 市场、增长 - 新用户付费区间
 */
@RequestMapping("/api/v1/new-range-pay")
@RestController
public class NewRangePayController extends BaseController {

    @Autowired
    private NewRangePayService newRangePayService;

    /**
     * 列表查询
     */
    @PostMapping("/query")
    public Result<List<NewRangePayStat>> query(NewRangePayQueryVO vo) {
        if (vo.getRegisterSourceGroupId() != null && vo.getLabelGroupId() != null){
            return Result.error().msg("渠道分组和标签分组无法同时筛选");
        }
        List list = newRangePayService.list(vo);
        return Result.success().data(list).msg("查询成功");
    }

    /**
     * 导出查询
     */
    @PostMapping("/export")
    public void export(NewRangePayQueryVO vo) {
        newRangePayService.export(vo);
    }
}
